#pragma once
#include <winsock.h>
#include "IEventHandler.h"
#include "Handler.h"

#define HANDLE_CONNECTION_SIZE FD_SETSIZE

class DemuxTable
{
public:
    // Convert <Tuple> array to <fd_set>s
    void convert_to_fd_sets (fd_set *read_fds, fd_set *write_fds, fd_set *except_fds);

	struct HandleConnection
    {
		 // Pointer to <Event_Handler> that process
		 // the indication event arriving on the handle
		IEventHandler<SOCKET> *eventhandler;

		// Bit-mask that tracks which types of indication events
		// <Event_Handler> is registered for
		Event_Type eventType;
    };

	// FD_SETSIZE macro defined in <winsock.h>
	HandleConnection handleConnection[HANDLE_CONNECTION_SIZE];
};